package sctu.edu.java.year2016.team01.xuhanmei.day20160522.chapter6_2;

/**
 * Created by Administrator on 2016/5/22.
 */

public class deleteblank {
    public static void main(String[] args) {
        //   System.out.println("请输入字符串：");
        // Scanner scan=new Scanner(System.in);
        // String a=scan.nextLine();


        String a = "i wa nt to s lee p";
        System.out.print("没去除空格前的字符串为：" + a);


        System.out.println("去除空格之后的字符串为：");
        for (int i = 0; i < a.length(); i++) {
            char s = a.charAt(i);
            if (s != ' ') {
                System.out.print(s);
            }
        }
    }
}
